#include<iostream>
#include<csignal>
using namespace std;

int main()
{
    sigset_t news;
    sigset_t olds;

    sigemptyset(&news);  //清空信号集
    sigemptyset(&olds);  //清空信号集

    cout<<"信号add设置前"<<endl;
    if(sigismember(&news,SIGINT))
        cout<<"当前位存在"<<endl;
    else    
        cout<<"当前位不存在"<<endl;

    sigaddset(&news,2);
    cout<<"信号add设置后"<<endl;
    if(sigismember(&news,SIGINT))
        cout<<"当前位存在"<<endl;
    sigprocmask(SIG_BLOCK,&news,&olds);

     if(sigismember(&news,SIGINT))
        cout<<"当前位存在"<<endl;

    return 0;
}